#ifndef __ISOUNDEFFECT_H__
#define __ISOUNDEFFECT_H__

#pragma once
#include "IAudio.h"




namespace audio {

/**
 * \ingroup CoreEngine
 *
 * \date 03-28-2007
 *
 * \author altjohann
 *
 * \todo 
 *
 * \bug 
 *
 */
class DLL_EXPORT ISoundEffect
{
public:
	ISoundEffect();
	virtual ~ISoundEffect(void);
	
	virtual bool play(int numOfLoops, bool deleteAfterPlaying)=0;
	
	virtual void stop(bool fadeOut)=0;
	
	// Do update shit: positioning, ... 
	virtual void update(const double &dt)=0;

	// change the volume "on-the-fly"
	virtual void setVolume( float vol) = 0;

	/*
	*	Get the state of the ISoundEffect:
	*	ISOUNDEFFECT_PLAYING, ISOUNDEFFECT_STOPPED...
	*/
	virtual int getState()=0;

	/**
	*
	*/
	int getPlayCounter();

	/*
	*	Play the sound in loop?
	*/
	virtual void setLoop(bool _val)=0;
	
	/*
	*	Linke the ISound-Position to the ITransformable?
	*	!!!Achtung!!! Set to false before destroying the WorldObject
	*/
	virtual void linkPositionToObject(bool _val)=0;


	/**
	*	Returns if the soundeffect has been played
	*/
	bool getHasBeenPlayed();

	bool m_bDeleteAfterPlaying; ///< Is this source deleted after been played for one time
	bool m_bHasBeenPlayed; ///< Has this SoundEffect has been played yet? 

	SfxID soundID;

protected:
	
	int m_iPlayCounter; ///< How many times this sorce was played
};

} // namespace audio

#endif // __ISOUNDEFFECT_H__
